#ifndef _QRCODE_SOURCE_H_
#define _QRCODE_SOURCE_H_

#include <opencv2/opencv.hpp>
#include <iostream>

class IQrCodeSource
{
public:
	virtual ~IQrCodeSource() {}

	virtual cv::Mat getQrCode() = 0;

	virtual IQrCodeSource& operator >> (cv::Mat& image) = 0;
};

class CameraQrCodeSource : public IQrCodeSource
{
public:
	CameraQrCodeSource();
	virtual ~CameraQrCodeSource();

	virtual cv::Mat getQrCode() override;
	virtual CameraQrCodeSource& operator >> (cv::Mat& image) override;

private:
	cv::VideoCapture* pCap = nullptr;
};

class AviQrCodeSource : public IQrCodeSource
{
public:
	AviQrCodeSource();
	virtual ~AviQrCodeSource();

	virtual cv::Mat getQrCode() override;
	virtual AviQrCodeSource& operator >> (cv::Mat& image) override;

private:
	cv::VideoCapture* pCap = nullptr;
};

#endif


